package com.lm.activiti.boot.cases;

/**
 * @author lm_jcf
 * @date 2022/6/21 10:07
 */
public class TryFinallyCase {

    public int aaa(){
        Integer i = 1;

        try {
            return ++i;
        } catch (Exception e) {

        }finally {
            ++i;
        }
        return i;
    }

    public Parent iii(){
        Parent parent = new Parent();

        try {
            ++parent.age;
            return parent;
        } catch (Exception e) {

        }finally {
            ++parent.age;
            ++parent.age;
        }
        return parent;
    }

    public String sss() throws Exception {
        String s = "";

        try {


            return s = "s";
        } catch (Exception e) {

        }finally {
            s = "ss";
//            throw new Exception("eed");
        }

        return s;
    }

    public static void main(String[] args) throws Exception {
        TryFinallyCase tryFinallyCase = new TryFinallyCase();
//        Integer y = tryFinallyCase.aaa();
//        System.out.println(y);
        System.out.println(tryFinallyCase.sss());

        Parent parent = tryFinallyCase.iii();
        System.out.println(parent.age);
    }
}
